using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using Easy.Authorization.Models;
using Easy.Authorization.Models.Mapping;
using Easy.Common.RegisterType;
using Easy.Domain.Core;

namespace Easy.Authorization
{
    partial class AuthorizationUnitOfWork : UnitOfWork, IAuthorizationUnitOfWork
    {
        static AuthorizationUnitOfWork()
        {
            Database.SetInitializer<AuthorizationUnitOfWork>(null);
        }

        public AuthorizationUnitOfWork()
            : base("Name=AuthorizationContext")
        {
        }


        public DbSet<Aut_Columns> Aut_Columns { get; set; }
        public DbSet<Aut_Models> Aut_Models { get; set; }
        public DbSet<Aut_Navigations> Aut_Navigations { get; set; }
        public DbSet<Aut_RoleModelMaps> Aut_RoleModelMaps { get; set; }
        public DbSet<Aut_RoleNavigateMaps> Aut_RoleNavigateMaps { get; set; }
        public DbSet<Aut_Roles> Aut_Roles { get; set; }
        public DbSet<Aut_Rows> Aut_Rows { get; set; }
        public DbSet<Aut_UserRoleMaps> Aut_UserRoleMaps { get; set; }
        public DbSet<Aut_Users> Aut_Users { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new Aut_ColumnsMap());
            modelBuilder.Configurations.Add(new Aut_ModelsMap());
            modelBuilder.Configurations.Add(new Aut_NavigationsMap());
            modelBuilder.Configurations.Add(new Aut_RoleModelMapsMap());
            modelBuilder.Configurations.Add(new Aut_RoleNavigateMapsMap());
            modelBuilder.Configurations.Add(new Aut_RolesMap());
            modelBuilder.Configurations.Add(new Aut_RowsMap());
            modelBuilder.Configurations.Add(new Aut_UserRoleMapsMap());
            modelBuilder.Configurations.Add(new Aut_UsersMap());
        }
    }
}
